import Cookies from 'js-cookie';

export const getSearchHistory = () => {
  if(Cookies.get('searchHistory')) {
    return JSON.parse(Cookies.get('searchHistory'));
  }
  return []
}

export const setSearchHistory = (searchHistory) => {
  Cookies.set('searchHistory', JSON.stringify(searchHistory));
}

export const getSearchText= () => {
  if(Cookies.get('searchText')) {
    return Cookies.get('searchText');
  }
  return ''
}

export const setSearchText = (searchText) => {
  Cookies.set('searchText', searchText);
}
